$(function(){
	$('.app-thumbnail').each(function(){
		var e = $(this);
		if(e.attr("title")=="") return;
		e.bt('<img src="'+e.attr("title")+'" width="400" height="300" />', 
		{
			width: 400, 
			height: 300,
			fill: 'white',
			strokeStyle: '#999',
			shrinkToFit: true,
			hoverIntentOpts: {interval: 0,timeout: 0}
		});
	});
});



function install(iAppID)
{
	var e = document.getElementById("button-"+iAppID);
	e.disabled = true;
	$.ajax({
		type: "GET",
		url: "./?app=app&task=ajax_install&application_id="+iAppID,
		dataType: "json",
		success: function(json){
			e.disabled = false;
			if(json.status=="0")
			{
				alert("安装成功， 现右你可以新建菜单连接到本应用!");
				$("#app-"+iAppID).attr("class","installed");
			}
			else
			{
				alert("按装失败: "+json.description);
			}
		}
	});	
}
